{include file="public:header" /}
{include file="public:nav" /}

<div class="row">
    <div class="col-md-8">
        <div class="page-header">
            <h2 class="text-center">发布文章</h2>
            <form  method="post" id="login" action="{:url('index/index/save')}" enctype="multipart/form-data">
                <input type="hidden" name="user_id" value="{$Think.session.user_id}">

                <div class="form-group">
                    <label for="title" class="control-label">标题:</label>
                        <input type="text" name="title" class="form-control" id="title" placeholder="文章标题">
                </div>

                <div class="form-group">
                    <label for="title" class="control-label">分类:</label>
                    <select name="cate_id" id="" class="form-control">
                        {volist name="cateList" id="cate"}<!--遍历-->
                        <option value="{$cate.id}">{$cate.name}</option>
                        {/volist}
                    </select>
                </div>

                <div class="form-group">
                    <label for="title" class="control-label">内容:</label>
                    <textarea class="form-control" name="content" id="content" style="min-height: 250px"></textarea>
                </div>

                <div class="form-group">
                    <label for="title_img" class="control-label">选择图片:</label>
                    <input type="file" name="title_img" class="form-control" id="title_img" placeholder="标题图片">
                </div>
                <!--name=""要和数据库中的字段一致-->

                <div class="form-group">
                    <button type="submit" class="btn btn-primary" id="submit">发布</button>
                </div>


            </form>

            {//富文本编辑器}
            <script >
                bkLib.onDomLoaded(function() {
                    new nicEditor({iconsPath : '/static/js/nicEditorIcons.gif'}).panelInstance('content');
                });
            </script>
        </div>
    </div>

            {include file="public:right" /}
            {include file="public:footer" /}